package top.csmcool.musicapi.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import top.csmcool.musicapi.domain.UserPlatformBindInfo;
import top.csmcool.musicapi.domain.Users;
import top.csmcool.musicapi.model.admin.PageVO;
import top.csmcool.musicapi.model.admin.SystemSetting;
import top.csmcool.musicapi.model.admin.UserPlatformBindInfoPageRequest;
import top.csmcool.musicapi.model.admin.UsersRequest;
import top.csmcool.musicapi.model.result.Request;
import top.csmcool.musicapi.model.result.Result;
import top.csmcool.musicapi.service.AdminService;

/**
 * @Description
 * @Author shizhe
 * @Date 2025/2/13
 */

@RestController("/admin")
@RequiredArgsConstructor
public class AdminController {

    private final AdminService adminService;

    @PostMapping("/queryUserPlatformBindInfo")
    public Result<PageVO<UserPlatformBindInfo>> queryUserPlatformBindInfo(Request<UserPlatformBindInfoPageRequest> request) {
        return adminService.queryUserPlatformBindInfo(request);
    }

    @PostMapping("/queryUsers")
    public Result<PageVO<Users>> queryUsers(Request<UsersRequest> request) {
        return adminService.queryUsers(request);
    }

    @PostMapping("/querySystemSetting")
    public Result<SystemSetting> querySystemSetting() {
        return adminService.querySystemSetting();
    }

    @PostMapping("/updateUserInfo")
    Result<Users> updateUserInfo(Request<Users> request) {
        return adminService.updateUserInfo(request);
    }

    @PostMapping("/updatePlatformInfo")
    Result<UserPlatformBindInfo> updatePlatformInfo(Request<UserPlatformBindInfo> request) {
        return adminService.updatePlatformInfo(request);
    }
}
